home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / MacSource / PovMac.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-16  |  7.8 KB  |  260 lines  |  [TEXT/CWIE]

  1. /*==============================================================================
  2. Project:    POV-Ray
  3.  
  4. Version:    3
  5.  
  6. File:    PovMac.h
  7.  
  8. Description:
  9.     This file contains typedefs, function prototypes and extern var declarations
  10.     that need to be exported from pov.c.
  11. ------------------------------------------------------------------------------
  12. Authors:
  13.     Thomas Okken, David Lichtman, Glenn Sugden
  14.     Jim Nitchals, Eduard [esp] Schwan
  15. ------------------------------------------------------------------------------
  16.     from Persistence of Vision(tm) Ray Tracer
  17.     Copyright 1996 Persistence of Vision Team
  18. ------------------------------------------------------------------------------
  19.     NOTICE: This source code file is provided so that users may experiment
  20.     with enhancements to POV-Ray and to port the software to platforms other 
  21.     than those supported by the POV-Ray Team.  There are strict rules under
  22.     which you are permitted to use this file.  The rules are in the file
  23.     named POVLEGAL.DOC which should be distributed with this file. If 
  24.     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  25.     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  26.     Forum.  The latest version of POV-Ray may be found there as well.
  27.  
  28.     This program is based on the popular DKB raytracer version 2.12.
  29.     DKBTrace was originally written by David K. Buck.
  30.     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  31. ------------------------------------------------------------------------------
  32. Change History:
  33.     920815    [jln]    version 1.0 Mac released.
  34.     920908    [esp]    version 1.1 alpha Mac
  35.     921221    [esp]    Changed to include QuickTime 1.5 Headers
  36.     930826    [esp]    Added 1.x/2.x ifdefs in
  37.     931001    [esp]    version 2.0 finished (Released on 10/4/93)
  38.     931119    [djh]    2.0.1 source conditionally compiles for PPC machines, keyword __powerc
  39.     940430    [esp]    Preliminary 3.0a1 work
  40.     950629    [esp]    Changed alpha app signature from 'POV0' to 'POV3'
  41. ==============================================================================*/
  42.  
  43. #if !defined(POVMAC_H)
  44. #define POVMAC_H
  45.  
  46.  
  47. /*==== POV definitions =====*/
  48. #include "config.h"
  49. #include "FRAME.H"
  50. #include "Printf2Window.h"        // p2w_WindowPtr_t
  51.  
  52. /*==== Mac definitions =====*/
  53.  
  54.  
  55. /*==== QuickTime compression headers ====*/
  56.  
  57. #include <ImageCompression.h>
  58. #include <QuickTimeComponents.h>    // ComponentInstance
  59.  
  60.  
  61. /*==== Animate header ====*/
  62. #include "Animate.h"    // for AnimRec_t definition in prefs
  63.  
  64.  
  65.  
  66. /*==== Think to non-THINK compatibility ====*/
  67.  
  68. #if !defined(THINK_C)
  69. #include <Strings.h>    // p<->cstr
  70. #endif // THINK_C
  71.  
  72.  
  73. /*==== definitions ====*/
  74.  
  75. // default stack size
  76. #define    DEFAULT_STACK_SIZE        80000
  77.  
  78. // #define _QD32Trap 0xAB03 /* 32 bit Quickdraw trap */
  79.  
  80. #define kRsrcFileClosed            (-1)
  81.  
  82. /* keyboard values used by ModalFilter() */
  83. /*
  84. #define kReturnKey                0x0D
  85. #define kEnterKey                0x03
  86. #define kEscKey                    0x1B
  87. #define kTabKey                    0x09
  88. */
  89.  
  90. /* All dialogs have a user item #3 for outlining buttons */
  91. // #define kDefaultItem            3
  92.  
  93. /* Windows */
  94. #define    kWindID_p2w                9600    // POV-Ray status window
  95.  
  96. /* Dialog resource IDs */
  97. #define    kdlog_P2W_INIT_ERROR    9600
  98.  
  99. #define    kdlog_ConfigFatalErr    129    // bad hardware/software config
  100. #define    kdlog_GenericFatalErr    152 // general purpose fatal error dialog
  101. #define    kdlog_CantOpenOverDirty    154    // cant open over existing busy file
  102. #define    kdlog_CantOpenNonText    155    // cant open non-text files
  103. #define    kdlog_UseFPUVersion        158    // Note: should use FPU version of POV-Ray
  104. #define    kdlog_UsePPCVersion        159    // Note: should use PPC version of POV-Ray
  105.  
  106. /* our application's creator signature */
  107. #define    kAppSignature        'POV3'
  108.  
  109. /* the Creator type for non-launchable POV-Ray files (like Prefs) */
  110. // #define    kAppXtraSignature    'POVX'
  111. // NOTE: The above style of creating PREFs files that are not connected
  112. // to the app's signature was suggested by Apple at one time, since it
  113. // kept the app from launching if the user double-clicked the prefs file.
  114. // However, a more serious problem arises by doing this... "prefs-killer"
  115. // applications that delete prefs files whose owner doesn't exist on the
  116. // hard drive, mistakenly see POV-Ray's prefs file as an orphan, and
  117. // delete it!  Therefore, because of an Apple employee's last minute bug
  118. // report (right before 3.0 release), I've gone ahead and changed the
  119. // Prefs file creator signature back to POV-Ray 3, and POVX isn't used.
  120.  
  121. /* POV Menu equates */
  122. #define num_of_menus    7
  123. #define num_of_submenus 3
  124. #define menu_offset        128        // ID of the first menu
  125. #define submenu_offset    200        // ID of the first submenu
  126.  
  127. /* Apple Menu */
  128. #define apmn_ID            128
  129. #define apmn_about        1
  130.  
  131. /* File Menu */
  132. #define fmn_ID            129
  133. #define fmn_new            1
  134. #define fmn_open        2
  135. #define fmn_close        4
  136. #define fmn_save        5
  137. #define fmn_saveas        6
  138. #define fmn_revert        7
  139. #define fmn_quit        9
  140.  
  141. /* Edit Menu */
  142. #define edmn_ID            130
  143. #define edmn_undo        1
  144. #define edmn_cut        3
  145. #define edmn_copy        4
  146. #define edmn_paste        5
  147. #define edmn_clear        6
  148. #define edmn_selectAll    7
  149. #define edmn_redo        9
  150. #define edmn_goto        11
  151. #define edmn_matchbrace    12
  152. #define edmn_prefs        14
  153.  
  154. /* Template Menu */
  155. #define temn_ID            131
  156. #define temn_import        1
  157.  
  158. /* Image Menu */
  159. #define immn_ID            132
  160. #define immn_view        1
  161. #define immn_dither        2
  162. #define immn_custom     3
  163. #define immn_process     4
  164.  
  165. /* Render Menu */
  166. #define rnmn_ID            133
  167. #define rnmn_render        1
  168. #define rnmn_pause        2
  169. #define rnmn_stop        3
  170.  
  171. /* Windows Menu */
  172. #define wndmn_ID        134
  173. #define wndmn_status    1
  174. #define wndmn_source    2
  175. #define wndmn_image        3
  176. #define wndmn_autoscroll    5
  177.  
  178. /* View submenu */
  179. #define viewmn_ID        200
  180. #define viewmn_hidden        1
  181. #define viewmn_Size2Window    2
  182. #define viewmn_normal        3
  183. #define viewmn_x2            4
  184. #define viewmn_x3            5
  185. #define viewmn_x4            6
  186.  
  187. /* palette submenu */
  188. #define plmn_ID            201
  189. #define palette_none    1
  190. #define palette_default    3
  191. #define palette_median    4
  192. #define palette_popular 5
  193. #define palette_var_min    6
  194. #define palette_octree    7
  195.  
  196. /* prefs submenu */
  197. #define pfmn_ID            202
  198. #define pref_app        1
  199. #define pref_file        2
  200.  
  201. /* don't want to collide with system equates, so... */
  202. #define varianceMethod    1000
  203. #define octreeMethod    1001
  204.  
  205.  
  206. #if !defined (min)
  207. #define min(x,y) ((x>y)?y:x)
  208. #endif // min
  209.  
  210.  
  211. // Application internal configuration settings resource (stack size, etc.)
  212. #define    kAppConfigRsrc            'CNFG'
  213. #define    kAppConfigRsrcID        1000
  214.  
  215. typedef struct
  216. {
  217.     long        stackSize;            // # of bytes to grow stack to
  218.     long        reserved1;            // currently unused
  219.     long        reserved2;            // currently unused
  220. } app_config_rec_t, *app_config_ptr_t, **app_config_hdl_t;
  221.  
  222.  
  223. /*==== POV-Ray engine globals ====*/
  224.  
  225. // need to reference these from POV engine
  226. extern volatile int            Stop_Flag;
  227. extern struct Token_Struct    Token;                    // tokenize.c
  228.  
  229.  
  230. /*==== pov.c globals ====*/
  231.  
  232. extern p2w_WindowPtr_t    gp2wWindow;                    // the Status (text) window
  233.  
  234. extern Boolean            gHasAppleEvents;            // Apple Events available for doing shutdown?
  235. extern Boolean            gHas32BitQD;                 // is 32 bit Quickdraw available for depth & dithering
  236. extern Boolean            gHasPictUtils;                // is Picture Utils (extract best palette) avail?
  237. extern Boolean            gHasImageCompressionMgr;    // Is QuickTime Image compression available?
  238. extern Boolean            gHasQuickTime;                 // Is QuickTime available?
  239. extern long                gQTVersion;                    // QuicktTime version from Gestalt
  240. extern StringPtr        gDistMessage;                // concatenated from FRAME.H strings
  241. extern Boolean            gInBackground;                // is the program currently switched out
  242. extern Boolean            gDoingRender;                // for determining the menu states
  243. extern Rect                gDragBounds;                // window dragging boundary
  244. extern Boolean            gDoingBatchODOCs;             // in the middle of ODOC, postpone other odocs
  245. extern Boolean            gCanUndo;                    // can we undo this operation?
  246. extern Boolean            gCanRedo;                    // can we redo this operation?
  247. extern short            gAppRefNum;                    // The application's resource file refnum
  248.  
  249. extern Str31            gPictFname;                    // name of pict output file
  250. extern Str31            gOutFname;                    // name of other output file
  251.  
  252. extern ComponentInstance    gtheSCComponent;    
  253.  
  254. /*==== PowerPC-specific globals ====*/
  255.  
  256.  
  257. #include "povmacproto.h"
  258.  
  259. #endif // POVMAC_H
  260.